package com.cn.design.state;

/**
 * @author: zhangyiting
 * @description:
 * @createDate: Created in 2022/7/5 23:12
 * @version: 1.0
 */
public class ForenoonState extends State {
    @Override
    public void writeProgram(Work w) {

        if (w.getHour() < 12)
        {
            System.err.println("当前时间:上午"+w.getHour()+"点");
        } else {
            w.setState(new NoonState());
            w.writeProgram();
        }
    }
}


